/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package se.kth.lwr.jeat.core;

import java.util.LinkedList;
import java.util.List;
import javax.measure.quantity.Quantity;
import javax.measure.unit.Unit;
import org.jscience.physics.amount.Amount;

/**An AmountDataSource represents a simple form of traceable background data
 * that constitutes of an arbitrary <code>Amount</code>.
 *
 * @author david
 */
public class AmountDataSource<Q extends Quantity> extends DataSource<Amount<? extends Quantity>> {
    
/**
     * Creates a new AmountDataSource
     * @param name The name of the DataSource
     * @param description The description of the DataSource
     */
    
    
    public AmountDataSource(String name, String description, Amount<Q> value) {
        super(name, description, value);
        
    }
    
    /**
     * Returns the value of this data source and record the usage
     * @param user the activity that uses this data source
     * @return the value of the data source
     */

    @Override
    public Amount<? extends Quantity> useValue(Activity user) {
         return super.useValue(user);
    }
    
    /**
     * Returns the value of this data source without recording usage
     * @return the value of this data source
     */

    @Override
    public Amount<? extends Quantity> readValue() {
        return super.readValue();
    }
    
    
    /**
     * 
     * @return a report for this data source
     */
    
    @Override
    public Report getReport() {
        Report report=new Report();
        report.addRow("["+this.getClass().getSimpleName()+"]", readValue(), this.getDescription());
        return report;
    }
    }
